#!/usr/bin/perl
# $Id$
# Author: Charles Mauch (cmauch@gmail.com)
# Description: Just outputs the time in netbeats
# Legal: (c) 2006 2006 Charles Mauch, released under the terms of the GPLv2 (or later)

# Grabs date/time at GMT timezone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);

# This chnages the time from GMT to BST since Swatch beats are based on BST
$bsthour = $hour+1;
if ($bsthour == 24) {
	$bsthour = 0;
}

# Getting number of seconds since 0:00
$sectot = $bsthour*60*60 + $min*60 + $sec;

# conversion
$beatsf12 = $sectot/86.4;

# integerize the beats
$beats = int($beatsf12);

#adding leading zero
if ($beats < 10) {
	$beats = "00$beats";
} elsif ($beats < 100) {
	$beats = "0$beats";
}

print "\@$beats";
